package com.demo.di;

public class BookServiceImpl implements BookService {
    //1.之前写法接口=实现类
    //private  BookDao bookDao=new BookDaoImpl();
    private BookDao bookDao;
    
    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }
    
    public void addBook() {
        this.bookDao.save();
    }
    
    public BookServiceImpl() {
        System.out.println("被 new 了");
    }
}
